The present invention relates to a technique for continuing to read data rapidly and appropriately when an unrecoverable read error occurs in a tape reader connected to a host computer.
In a tape drive for reading digital data from a magnetic tape, part of data recorded on the magnetic tape may be unreadable for some reason. When an unrecoverable read error occurs, the conventional tape drive reports the read error to the host computer, and ends reading. To continue reading data, an application of the host computer needs to avoid a part where the error occurs and read data after it.
Typically, the host computer manages the reading position of data based on how many records are in the minimum unit of data as seen from the host computer and how many format marks indicating the boundary of record block are read. On the other hand, the tape drive records data in data units differently than the host computer on the magnetic tape. Therefore, the data unit includes a plurality of records and file marks. However, the length of record is not necessarily fixed. Also, the tape drive often records data after compressing data received from the host computer. Therefore, when the data unit is unreadable for some reason, the host computer cannot know the number of records and the number of file marks included in the data.
Thus, to avoid a portion of the tape where the error occurs, the host computer needs to perform a method of 1) moving the reading position forward by small steps and trying the readability of data at every step, or 2) moving the reading position to the sufficiently far position and starting reading. However, with the method of 1), many tries are necessary, and it takes a long time to read. On the other hand, with the method of 2), data that is originally readable may be canceled.
The conventional technique for conveying the next readable data position to the host computer when an unrecoverable error occurs was described in Published Unexamined Japanese Patent Application No. 2002-251843, for example. Published Unexamined Japanese Patent Application No. 2002-251843 deals with a tape drive unit conforming to the Advanced Intelligent Tape (AIT) standards for recording or reproducing data via the tape by handling data in group units, and a host system for controlling the tape drive unit. And Published Unexamined Japanese Patent Application No. 2002-251843 discloses a technique in which the beginning of group and the beginning of sector are made coincident in allotting data in group units to sector units of the minimum processing units of the host system, and when a reproduction error occurs, the first record number of group and the error information for every frame making up the group are only returned from the tape drive unit to the host system, and the error sector can be computed on the side of the host system.
However, the technique as disclosed in Published Unexamined Japanese Patent Application No. 2002-251843 presupposes that the length of data recorded on the magnetic tape can be converted to the data length handled by the host computer. Therefore, in the case where the length of record in the minimum data unit as seen from the host computer is variable, or the tape drive compresses data from the host computer and records it in the magnetic tape, the technique of Published Unexamined Japanese Patent Application No. 2002-251843 cannot be used, whereby it is still difficult to find the next readable position in the host computer rapidly and suitably.
There is thus a need to provide a tape reader, system, method and/or program that can solve the above-mentioned problems.